/*
 * IJA2011, Board game "Clovece nezlob se"
 * grp108
 * Tomáš Mičiak,xmicia00
 * Andrej Martinák, xmarti51
 *
 * Created on 4.5.2011, 16:16:58
 */

package src.clovece;

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author Thomas
 */
public class AboutDialog extends javax.swing.JDialog {
    private Image backround = null;

    AboutDialog(GameFrame parent, boolean modal) {
        super(parent, modal);
        this.setResizable(false);
        this.setLocation(parent.getX()+300, parent.getY()+200);
    }

    public void showYourself() {
        initComponents();
        JLabel photo = new JLabel(new ImageIcon(System.getProperty("user.dir")+ System.getProperty("file.separator")
                  + "lib" + System.getProperty("file.separator") + "img"
                  + System.getProperty("file.separator") + "authors.jpg"));
        photo.setBounds(20, 40, 370, 180);
        this.add(photo);
        this.setVisible(true);
    }

    
    protected void paintComponent(Graphics g) {
        if (this.backround != null)
            g.drawImage(this.backround, 0,0,this.getWidth(),this.getHeight(),this);
        else System.out.println("fuuuu fighetrs");
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        AuthorsLabel = new javax.swing.JLabel();
        OkButton = new javax.swing.JButton();
        VersionLabel = new javax.swing.JLabel();
        TomasLabel = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        AuthorsLabel.setText("Authors:");

        OkButton.setText("OK");
        OkButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                OkButtonMouseClicked(evt);
            }
        });

        VersionLabel.setText("Version:");

        TomasLabel.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        TomasLabel.setForeground(new java.awt.Color(255, 0, 0));
        TomasLabel.setText("Tomas Miciak");

        jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 0, 255));
        jLabel1.setText("Andrej Martinak");

        jLabel2.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel2.setText("&");

        jLabel3.setText("1.0 final release");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(159, Short.MAX_VALUE)
                .addComponent(OkButton, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(138, 138, 138))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AuthorsLabel)
                    .addComponent(VersionLabel))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addComponent(TomasLabel)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel1)))
                .addContainerGap(61, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AuthorsLabel)
                    .addComponent(TomasLabel)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 199, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(VersionLabel)
                    .addComponent(jLabel3))
                .addGap(21, 21, 21)
                .addComponent(OkButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void OkButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OkButtonMouseClicked
        this.dispose();
    }//GEN-LAST:event_OkButtonMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel AuthorsLabel;
    private javax.swing.JButton OkButton;
    private javax.swing.JLabel TomasLabel;
    private javax.swing.JLabel VersionLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration//GEN-END:variables

}
